DIRECTORIES=${wildcard src/*}
MODE ?=release

all:
	mkdir -p bin/$(MODE)
	mkdir -p lib/$(MODE)
	mkdir -p .objs/$(MODE)
	@echo $(DIRECTORIES)
	@for i in $(DIRECTORIES); do \
		cd $$i; $(MAKE) MODE=$(MODE) ; cd ../..; \
	done
	cd bin; $(MAKE) MODE=$(MODE) ; cd ..;

doc:
	mkdir -p docs/html
	cp docs/icon.jpg docs/html/
	doxygen

tests: 
	cd test ; $(MAKE) MODE=$(MODE) ; cd ..; echo "Tests Passed:WikiMouse working correctly";
clean:
	@echo $(DIRECTORIES)
	@for i in $(DIRECTORIES); do \
		cd $$i; $(MAKE) clean; cd ../..; \
	done
	rm -f .objs/release/*.o .objs/debug/*.o
	rm -f bin/release/* bin/debug/*
	rm -f docs/html/*
